﻿@{
    ViewBag.Title = "Laptops";
    ViewBag.BackUrl = Url.Action("Laptops", "Product");
    LineFocus.Nikcron.Models.Lookup Manufactures = ViewBag.Manufactures;
}

@model Nickron.Database.Laptop

@using (Html.BeginForm("LaptopMaintenance", "Product", FormMethod.Post, new { onsubmit = "return ValidateForm();" }))
{

    <div class="col-md-6">
        <div class="box box-danger">
            <div class="box-body">

                <div class="box-header">
                    <h3 class="box-title"> General Feature</h3>
                </div>

                <div class="form-group">
                    <label>Product Date:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class="fa fa-calendar"></i>
                        </div>
                        <input name="ProductDate" id="ProductDate" type="text" data-mask="" data-inputmask="'alias': 'dd/mm/yyyy'" class="form-control">
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>In The Box:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="InBox" name="InBox" type="text" maxlength="1000" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Model Number:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="ModelNumber" name="ModelNumber" type="text" maxlength="200" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Model Name:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="ModelName" name="ModelName" type="text" maxlength="500" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Manufacture:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <select id="Manufacture" name="Manufacture" class="selectpicker" title="Select Manufacture">
                            @Html.Partial("Dropdown", Manufactures)
                        </select>
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Series:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="Series" name="Series" type="text" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Color:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="ProductColors" name="ProductColors" type="text" class="form-control" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="box-header">
                    <h3 class="box-title">Processor</h3>
                </div>

                <div class="form-group">
                    <label>Processor:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Processor" name="Processor" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Chipset:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Chipset" name="Chipset" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Clock Speed:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="ClockSpeed" name="ClockSpeed" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Cache:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Cache" name="Cache" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="box-header">
                    <h3 class="box-title">Memory</h3>
                </div>

                <div class="form-group">
                    <label>Expandable Memory:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="ExternalStorage" name="ExternalStorage" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Memory Slots:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Memoryslote" name="Memoryslote" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>System Memory:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Systemmemory" name="Systemmemory" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>RAM Type:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Ramtype" name="Ramtype" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>No Of RAM:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Noofram" name="Noofram" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="box-header">
                    <h3 class="box-title">Storage</h3>
                </div>

                <div class="form-group">
                    <label>Hardware Interface:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="HardwareInterface" name="HardwareInterface" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>RPM:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="RPM" name="RPM" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>HDD Capacity:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="HDDCapacity" name="HDDCapacity" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Optical Drive:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="OpticalDrive" name="OpticalDrive" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Additional Features:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <textarea id="NoteSummary" name="NoteSummary" maxlength="1000" class="form-control pull-right"></textarea>
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>WarrantySummary:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <textarea id="WarrantySummary" name="WarrantySummary" maxlength="1000" class="form-control pull-right"></textarea>
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="box-header">
                    <h3 class="box-title">Platform</h3>
                </div>

                <div class="form-group">
                    <label>Operating System:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="OperatingSystem" name="OperatingSystem" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>System Architecture:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="SystemArch" name="SystemArch" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->


            </div><!-- /.box-body -->
        </div><!-- /.box -->

    </div><!-- /.col (left) -->
    <div class="col-md-6">
        <div class="box box-primary">
            <div class="box-body">

                <div class="box-header">
                    <h3 class="box-title">Display</h3>
                </div>

                <div class="form-group">
                    <label>Display Size:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="DisplaySize" name="DisplaySize" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Display Type:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="DisplayType" name="DisplayType" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="box-header">
                    <h3 class="box-title">Graphics & Input</h3>
                </div>

                <div class="form-group">
                    <label>Graphic Processor:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="GraphicProcessor" name="GraphicProcessor" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Keyboard:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i class=""></i>
                        </div>
                        <input id="Keyboard" name="Keyboard" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="box-header">
                    <h3 class="box-title">Audio</h3>
                </div>

                <div class="form-group">
                    <label>Speakers:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Speakers" name="Speakers" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Sound:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Sound" name="Sound" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="box-header">
                    <h3 class="box-title">Communication</h3>
                </div>

                <div class="form-group">
                    <label>Ethernet:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Communication" name="Communication" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Wireless LAN:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Wireless" name="Wireless" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Bluetooth:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Bluetooth" name="Bluetooth" type="text" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="box-header">
                    <h3 class="box-title"> Ports & Slots</h3>
                </div>

                <div class="form-group">
                    <label>USB Port:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="USBport" name="USBport" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>RJ45 LAN:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="RJ45LAN" name="RJ45LAN" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>HDMI Port:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="HDMIPort" name="HDMIPort" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>VGA Port:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="VGAPort" name="VGAPort" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Multi Card Slot:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="MultiCardSlot" name="MultiCardSlot" type="text" maxlength="60" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="box-header">
                    <h3 class="box-title">  Machine Dimensions</h3>
                </div>

                <div class="form-group">
                    <label>Size:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Dimension" name="Dimension" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Weight:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Weight" name="Weight" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>WIDTH/DEPTH/HEIGHT:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="WidthHeight" name="WidthHeight" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Camera:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Camera" name="Camera" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Antivirus:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Antivirus" name="Antivirus" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Any Software:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Anysoftware" name="Anysoftware" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>Purpose (HOME/OFFICE):</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Purpose" name="Purpose" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>BUILT MATRIAL:</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="BuiltMatrial" name="BuiltMatrial" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>BATTERY TYPE/QTY:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="Batterytype" name="Batterytype" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>SCREEN TYPE (PAPER screen):</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="ScreenTyoe" name="ScreenTyoe" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="form-group">
                    <label>POWER ADAPTOR TYPE (OPTIONAL):</label>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="PowerAdaptor" name="PowerAdaptor" type="text" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->
                
                <div class="form-group">
                    <label>MRP:</label><span class="astrisk">*</span>
                    <div class="input-group">
                        <div class="input-group-addon">
                            <i></i>
                        </div>
                        <input id="MRP" name="MRP" type="number" maxlength="100" class="form-control pull-right" />
                    </div><!-- /.input group -->
                </div><!-- /.form group -->

                <div class="box box-success">
                    <div class="box-footer">
                        <input type="hidden" name="Id" id="Id" value="@ViewBag.Id" />
                        <button type="submit" class="btn btn-primary" style=" width:80px;">Save</button>
                        <button type="reset" class="btn btn-primary" onclick="GoBackListing()" style=" width:80px;">Cancel</button>
                    </div>
                </div><!-- /.box -->

            </div><!-- /.box-body -->
        </div><!-- /.box -->
    </div><!-- /.col (right) -->


    <script>
          function GoBackListing() {
              window.location.replace('@Url.Action("Laptops","Product",null)');
          }
    function ValidateForm() {
        RequiredTextbox("ModelNumber", "Enter the Model Number")
        RequiredTextbox("ModelName", "Enter the Model Name")
        RequiredDropdown("Manufacture", -1, "Select a Manufacture");
        RequiredTextbox("Series", "Enter the Series")
        RequiredTextbox("Processor", "Enter the Processor")
        RequiredTextbox("Chipset", "Enter the Chipset")
        RequiredTextbox("Memoryslote", "Enter the Memory slote")
        RequiredTextbox("Systemmemory", "Enter the System Memory")
        RequiredTextbox("Ramtype", "Enter the Ram type")
        RequiredTextbox("Noofram", "Enter the No of RAM")
        RequiredTextbox("HardwareInterface", "Enter the Hardware Interface")
        RequiredTextbox("RPM", "Enter the RPM")
        RequiredTextbox("HDDCapacity", "Enter the HDD Capacity")
        RequiredTextbox("OpticalDrive", "Enter the Optical Drive")
        RequiredTextbox("WarrantySummary", "Enter the WarrantySummary")
        RequiredTextbox("OperatingSystem", "Enter the Operating System")
        RequiredTextbox("DisplaySize", "Enter the Display Size")
        RequiredTextbox("DisplayType", "Enter the Display Type")
        RequiredTextbox("Keyboard", "Enter the Keyboard")
        RequiredTextbox("Communication", "Enter the Ethernet")
        RequiredTextbox("Wireless", "Enter the Wireless LAN")
        RequiredTextbox("Bluetooth", "Enter the Bluetooth")
        RequiredTextbox("USBport", "Enter the USB port")
        RequiredTextbox("RJ45LAN", "Enter the RJ45LAN")
        RequiredTextbox("Dimension", "Enter the Dimention Size")
        RequiredTextbox("Weight", "Enter the Dimention Weight")
        RequiredTextbox("Camera", "Enter the Camera")
        RequiredTextbox("Batterytype", "Enter the Battery Type")
        RequiredTextbox("ScreenTyoe", "Enter the Screen Type")
        RequiredTextbox("MRP", "Enter MRP");
        return AlertError();
    }
    @*function LoadManufactures() {
        $.getJSON("@Url.Action("GetLookups", "Master", new { LookupType = "Manufacture" })", function (result) {
                var options = '';
                $.each(result, function (item) {
                    options += '<option value="' + result[item].Id + '">' + result[item].Name + '</option>';
                });
                $("select#Manufacture").html(options);
            });
        }*@

        $(document).ready(function () {
            //LoadManufactures();
            $('.selectpicker').selectpicker();
            $('#ProductDate').datepicker();
            if ("@ViewBag.Id" != "0") {
                $('#Id').val('@Model.Id');
                $('#ProductDate').val('@Model.ProductDate');
                $('#InBox').val('@Model.InBox');
                $('#ModelName').val('@Model.ModelName');
                $('#ModelNumber').val('@Model.ModelNumber');
                $('#Manufacture').selectpicker("val", "@Model.ManufactureId");
                $('#Processor').val('@Model.Processor');
                $('#Chipset').val('@Model.Chipset');
                $('#ClockSpeed').val('@Model.ClockSpeed');
                $('#Cache').val('@Model.Cache');
                $('#ExternalStorage').val('@Model.ExternalStorage');
                $('#Memoryslote').val('@Model.MemorySlots');
                $('#Systemmemory').val('@Model.Memory');
                $('#HardwareInterface').val('@Model.HardwareInterface');
                $('#RPM').val('@Model.RPM');
                $('#HDDCapacity').val('@Model.HDDCapacity');
                $('#OpticalDrive').val('@Model.OpticalDrive');
                $('#NoteSummary').val('@Model.NoteSummary');
                $('#WarrantySummary').val('@Model.WarrantySummary');
                $('#OperatingSystem').val('@Model.OperatingSystem');
                $('#SystemArch').val('@Model.SystemArch');
                $('#DisplaySize').val('@Model.DisplaySize');
                $('#DisplayType').val('@Model.DisplayType');
                $('#GraphicProcessor').val('@Model.GraphicProcessor');
                $('#Keyboard').val('@Model.Keyboard');
                $('#Speakers').val('@Model.Speakers');
                $('#Sound').val('@Model.Sound');
                $('#USBport').val('@Model.USBPort');
                $('#RJ45LAN').val('@Model.RJ45LAN');
                $('#HDMIPort').val('@Model.HDMIPort');
                $('#VGAport').val('@Model.VGAPort');
                $('#MultiCardSlot').val('@Model.MultiCardSlot');
                $('#Dimension').val('@Model.Dimension');
                $('#Weight').val('@Model.Weight');
                $('#MRP').val('@Model.MRP.Amount.Value.ToString("f2")');
            @*$('#ProductColors').val('@Model.ProductColors');*@
            }
        });
    </script>




}
